<template>
    <div>
        <coursePlan v-if="showStatus == 1"/>
        <courseWillPlan v-if="showStatus == 2"/>
    </div>
</template>

<script>
import coursePlan from '@/pages/coursePlan/index.vue'
import courseWillPlan from '@/pages/courseWillPlan/index.vue'
import {NEWMODULEBATCHID} from '@/config/env'
export default {
    components: {
        coursePlan,
        courseWillPlan
    },
    data() {
        return {
            showStatus: 0
        };
    },
    onShow() { 
        let status  = wx.getStorageSync('plan_state')
        if (status == 1) {
           this.swithcPage()
        } 
    },
    async mounted() {
        this.swithcPage()
    },
    methods: {
        swithcPage () {
            this.batch_id = wx.getStorageSync('batch_id');
            if (this.batch_id <= NEWMODULEBATCHID) {
                this.showStatus = 1;
            } else {
                this.showStatus = 2;
            }
        }
    }
};
</script>
